﻿/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page11={
    create:function () {
        var page={};
        page.ui=new PIXI.DisplayObjectContainer();
        var bg=Easy.CreateSprite('assets/images/page_bg.png',0,0,0,0,1);
        page.ui.addChild(bg);

        var i0=Easy.CreateSprite('assets/images/p11_i0.png',115,106,0,0,0);
        page.ui.addChild(i0);
        var i1=Easy.CreateSprite('assets/images/p11_i1.png',234,551,0.5,0.5,0);
        page.ui.addChild(i1);
        var i2=Easy.CreateSprite('assets/images/p11_i2.png',493,526,0.5,0.5,0);
        page.ui.addChild(i2);

        var t0=Easy.CreateSprite('assets/images/p11_t0.png',338,743,0.5,0.5,0);
        page.ui.addChild(t0);
        var t1=Easy.CreateSprite('assets/images/p11_t1.png',250,848,0.5,0.5,0);
        page.ui.addChild(t1);
        var t2=Easy.CreateSprite('assets/images/p11_t2.png',237,922,0.5,0.5,0);
        page.ui.addChild(t2);
        var t3=Easy.CreateSprite('assets/images/p11_t3.png',280,992,0.5,0.5,0);
        page.ui.addChild(t3);

        var line=Easy.CreateSprite('assets/images/page_leftLine.png',0,96,0,0,0);
        line.width=23;
        line.height=1136;
        line.blendMode=PIXI.BLEND_MODES.MULTIPLY;
        page.ui.addChild(line);
        var line1=Easy.CreateSprite('assets/images/page_leftLine1.png',11,671,0.5,0.5,0);
        page.ui.addChild(line1);

        var tip=Easy.CreateSprite('assets/images/tip.png',370,1105,0.5,0.5,1);
        TweenMax.to(tip,1,{repeat:-1,yoyo:true,y:1105+30,alpha:0.7,ease:Cubic.easeInOut});
        page.ui.addChild(tip);

        var bt_locate=Easy.CreateSprite('assets/images/bt_locate.png',pixiStage.x+740,1020,1,0.5,1);
        bt_locate.interactive=true;
        page.ui.addChild(bt_locate);
        bt_locate.on('pointerdown',function()
        {
            showMap();
        });

        page.In=function () {
            i0.alpha=0;
            i0.x=115+150;
            TweenMax.to(i0,1.5,{delay:0.2*0,x:115,alpha:1});
            i2.x=493+60;
            i2.alpha=0;
            TweenMax.to(i2,1.5,{delay:0.2*1,x:493,alpha:1,ease:Cubic.easeInOut});
            i1.alpha=0;
            TweenMax.to(i1,1.5,{delay:0.2*2,alpha:1});


            t0.y=743+60;
            t0.alpha=0;
            TweenMax.to(t0,1.5,{delay:0.2*3,y:743,alpha:1,ease:Back.easeOut});
            t1.y=848+60;
            t1.alpha=0;
            TweenMax.to(t1,1.5,{delay:0.2*3,y:848,alpha:1,ease:Back.easeOut});
            t2.y=921+60;
            t2.alpha=0;
            TweenMax.to(t2,1.5,{delay:0.2*3,y:921,alpha:1,ease:Back.easeOut});
            t3.y=991+60;
            t3.alpha=0;
            TweenMax.to(t3,1.5,{delay:0.2*3,y:991,alpha:1,ease:Back.easeOut});

            line.x=-pixiStage.x;
            line.y=1136;
            line.alpha=0;
            TweenMax.to(line,1,{delay:0.3*3,y:0,alpha:1,ease:Cubic.easeInOut});
            line1.x=-pixiStage.x+11-30;
            line1.alpha=0;
            TweenMax.to(line1,1,{delay:0.3*3+0.1,x:-pixiStage.x+11,alpha:1,ease:Cubic.easeInOut});
        }
        page.Out=function()
        {
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(t2);
            TweenMax.killTweensOf(t3);
            TweenMax.killTweensOf(i0);
            TweenMax.killTweensOf(i1);
            TweenMax.killTweensOf(i2);
            TweenMax.killTweensOf(line);
            TweenMax.killTweensOf(line1);

            TweenMax.to(page.ui,0.3,{alpha:1,onComplete:function () {
                page.ui.alpha=1;
                i0.alpha=0;
                i1.alpha=0;
                i2.alpha=0;
                t0.alpha=0;
                t1.alpha=0;
                t2.alpha=0;
                t3.alpha=0;
                line.alpha=0;
                line1.alpha=0;
            }});
        }

        return page;
    }
}